from typing import List


class Solution:
    def letterCasePermutation(self, s: str) -> List[str]:
        ans = ['']
        for ch in s:
         
            if ch.isalpha():
                # 遍历ans 给每个元数未尾添分别添加大小写
                for i in range(len(ans)):
                    ansItem = ans[i]
                    ans[i] += ch.lower()
                    ans.append(ansItem + ch.upper())
            else:
                 for i in range(len(ans)):
                     ans[i] += ch
     
        return ans
                    